3.5.36 \(\int \cos ^6(c+d x) (a+b \tan ^2(c+d x)) \, dx\) [436]

Optimal. Leaf size=87 \[ \frac {1}{16} (5 a+b) x+\frac {(5 a+b) \cos (c+d x) \sin (c+d x)}{16 d}+\frac {(5 a+b) \cos ^3(c+d x) \sin (c+d x)}{24 d}+\frac {(a-b) \cos ^5(c+d x) \sin (c+d x)}{6 d} \]

[Out]

1/16*(5*a+b)*x+1/16*(5*a+b)*cos(d*x+c)*sin(d*x+c)/d+1/24*(5*a+b)*cos(d*x+c)^3*sin(d*x+c)/d+1/6*(a-b)*cos(d*x+c
)^5*sin(d*x+c)/d

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 87, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3756, 393, 205, 209} \begin {gather*} \frac {(a-b) \sin (c+d x) \cos ^5(c+d x)}{6 d}+\frac {(5 a+b) \sin (c+d x) \cos ^3(c+d x)}{24 d}+\frac {(5 a+b) \sin (c+d x) \cos (c+d x)}{16 d}+\frac {1}{16} x (5 a+b) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^6*(a + b*Tan[c + d*x]^2),x]

[Out]

((5*a + b)*x)/16 + ((5*a + b)*Cos[c + d*x]*Sin[c + d*x])/(16*d) + ((5*a + b)*Cos[c + d*x]^3*Sin[c + d*x])/(24*
d) + ((a - b)*Cos[c + d*x]^5*Sin[c + d*x])/(6*d)

Rule 205

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(-x)*((a + b*x^n)^(p + 1)/(a*n*(p + 1))), x] + Dist[(n*(p
 + 1) + 1)/(a*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x] /; FreeQ[{a, b}, x] && IGtQ[n, 0] && LtQ[p, -1] && (
IntegerQ[2*p] || (n == 2 && IntegerQ[4*p]) || (n == 2 && IntegerQ[3*p]) || Denominator[p + 1/n] < Denominator[
p])

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 393

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[(-(b*c - a*d))*x*((a + b*x^n)^(p
 + 1)/(a*b*n*(p + 1))), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x]
 /; FreeQ[{a, b, c, d, n, p}, x] && NeQ[b*c - a*d, 0] && (LtQ[p, -1] || ILtQ[1/n + p, 0])

Rule 3756

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[
{ff = FreeFactors[Tan[e + f*x], x]}, Dist[ff/(c^(m - 1)*f), Subst[Int[(c^2 + ff^2*x^2)^(m/2 - 1)*(a + b*(ff*x)
^n)^p, x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && IntegerQ[m/2] && (IntegersQ[n, p
] || IGtQ[m, 0] || IGtQ[p, 0] || EqQ[n^2, 4] || EqQ[n^2, 16])

Rubi steps

\begin {align*} \int \cos ^6(c+d x) \left (a+b \tan ^2(c+d x)\right ) \, dx &=\frac {\text {Subst}\left (\int \frac {a+b x^2}{\left (1+x^2\right )^4} \, dx,x,\tan (c+d x)\right )}{d}\\ &=\frac {(a-b) \cos ^5(c+d x) \sin (c+d x)}{6 d}+\frac {(5 a+b) \text {Subst}\left (\int \frac {1}{\left (1+x^2\right )^3} \, dx,x,\tan (c+d x)\right )}{6 d}\\ &=\frac {(5 a+b) \cos ^3(c+d x) \sin (c+d x)}{24 d}+\frac {(a-b) \cos ^5(c+d x) \sin (c+d x)}{6 d}+\frac {(5 a+b) \text {Subst}\left (\int \frac {1}{\left (1+x^2\right )^2} \, dx,x,\tan (c+d x)\right )}{8 d}\\ &=\frac {(5 a+b) \cos (c+d x) \sin (c+d x)}{16 d}+\frac {(5 a+b) \cos ^3(c+d x) \sin (c+d x)}{24 d}+\frac {(a-b) \cos ^5(c+d x) \sin (c+d x)}{6 d}+\frac {(5 a+b) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (c+d x)\right )}{16 d}\\ &=\frac {1}{16} (5 a+b) x+\frac {(5 a+b) \cos (c+d x) \sin (c+d x)}{16 d}+\frac {(5 a+b) \cos ^3(c+d x) \sin (c+d x)}{24 d}+\frac {(a-b) \cos ^5(c+d x) \sin (c+d x)}{6 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.15, size = 74, normalized size = 0.85 \begin {gather*} \frac {60 a c+60 a d x+12 b d x+3 (15 a+b) \sin (2 (c+d x))+(9 a-3 b) \sin (4 (c+d x))+a \sin (6 (c+d x))-b \sin (6 (c+d x))}{192 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^6*(a + b*Tan[c + d*x]^2),x]

[Out]

(60*a*c + 60*a*d*x + 12*b*d*x + 3*(15*a + b)*Sin[2*(c + d*x)] + (9*a - 3*b)*Sin[4*(c + d*x)] + a*Sin[6*(c + d*
x)] - b*Sin[6*(c + d*x)])/(192*d)

________________________________________________________________________________________

Maple [A]
time = 0.24, size = 102, normalized size = 1.17

method result size
risch \(\frac {5 a x}{16}+\frac {b x}{16}+\frac {\sin \left (6 d x +6 c \right ) a}{192 d}-\frac {\sin \left (6 d x +6 c \right ) b}{192 d}+\frac {3 \sin \left (4 d x +4 c \right ) a}{64 d}-\frac {\sin \left (4 d x +4 c \right ) b}{64 d}+\frac {15 \sin \left (2 d x +2 c \right ) a}{64 d}+\frac {\sin \left (2 d x +2 c \right ) b}{64 d}\) \(100\)
derivativedivides \(\frac {b \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{5}\left (d x +c \right )\right )}{6}+\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{24}+\frac {d x}{16}+\frac {c}{16}\right )+a \left (\frac {\left (\cos ^{5}\left (d x +c \right )+\frac {5 \left (\cos ^{3}\left (d x +c \right )\right )}{4}+\frac {15 \cos \left (d x +c \right )}{8}\right ) \sin \left (d x +c \right )}{6}+\frac {5 d x}{16}+\frac {5 c}{16}\right )}{d}\) \(102\)
default \(\frac {b \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{5}\left (d x +c \right )\right )}{6}+\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{24}+\frac {d x}{16}+\frac {c}{16}\right )+a \left (\frac {\left (\cos ^{5}\left (d x +c \right )+\frac {5 \left (\cos ^{3}\left (d x +c \right )\right )}{4}+\frac {15 \cos \left (d x +c \right )}{8}\right ) \sin \left (d x +c \right )}{6}+\frac {5 d x}{16}+\frac {5 c}{16}\right )}{d}\) \(102\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^6*(a+b*tan(d*x+c)^2),x,method=_RETURNVERBOSE)

[Out]

1/d*(b*(-1/6*sin(d*x+c)*cos(d*x+c)^5+1/24*(cos(d*x+c)^3+3/2*cos(d*x+c))*sin(d*x+c)+1/16*d*x+1/16*c)+a*(1/6*(co
s(d*x+c)^5+5/4*cos(d*x+c)^3+15/8*cos(d*x+c))*sin(d*x+c)+5/16*d*x+5/16*c))

________________________________________________________________________________________

Maxima [A]
time = 0.52, size = 97, normalized size = 1.11 \begin {gather*} \frac {3 \, {\left (d x + c\right )} {\left (5 \, a + b\right )} + \frac {3 \, {\left (5 \, a + b\right )} \tan \left (d x + c\right )^{5} + 8 \, {\left (5 \, a + b\right )} \tan \left (d x + c\right )^{3} + 3 \, {\left (11 \, a - b\right )} \tan \left (d x + c\right )}{\tan \left (d x + c\right )^{6} + 3 \, \tan \left (d x + c\right )^{4} + 3 \, \tan \left (d x + c\right )^{2} + 1}}{48 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^6*(a+b*tan(d*x+c)^2),x, algorithm="maxima")

[Out]

1/48*(3*(d*x + c)*(5*a + b) + (3*(5*a + b)*tan(d*x + c)^5 + 8*(5*a + b)*tan(d*x + c)^3 + 3*(11*a - b)*tan(d*x
+ c))/(tan(d*x + c)^6 + 3*tan(d*x + c)^4 + 3*tan(d*x + c)^2 + 1))/d

________________________________________________________________________________________

Fricas [A]
time = 3.69, size = 66, normalized size = 0.76 \begin {gather*} \frac {3 \, {\left (5 \, a + b\right )} d x + {\left (8 \, {\left (a - b\right )} \cos \left (d x + c\right )^{5} + 2 \, {\left (5 \, a + b\right )} \cos \left (d x + c\right )^{3} + 3 \, {\left (5 \, a + b\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{48 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^6*(a+b*tan(d*x+c)^2),x, algorithm="fricas")

[Out]

1/48*(3*(5*a + b)*d*x + (8*(a - b)*cos(d*x + c)^5 + 2*(5*a + b)*cos(d*x + c)^3 + 3*(5*a + b)*cos(d*x + c))*sin
(d*x + c))/d

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \tan ^{2}{\left (c + d x \right )}\right ) \cos ^{6}{\left (c + d x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**6*(a+b*tan(d*x+c)**2),x)

[Out]

Integral((a + b*tan(c + d*x)**2)*cos(c + d*x)**6, x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 3757 vs. \(2 (79) = 158\).
time = 2.26, size = 3757, normalized size = 43.18 \begin {gather*} \text {Too large to display} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^6*(a+b*tan(d*x+c)^2),x, algorithm="giac")

[Out]

1/96*(3*pi*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*ta
n(c))*tan(d*x)^6*tan(c)^6 + 30*a*d*x*tan(d*x)^6*tan(c)^6 + 6*b*d*x*tan(d*x)^6*tan(c)^6 + 3*pi*b*sgn(-2*tan(d*x
)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^6*tan(c)^6 + 9*pi*b*sgn(2*tan(d*x)^2*tan(c)
^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^6*tan(c)^4 + 9*pi*b*s
gn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)
^4*tan(c)^6 + 6*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(d*x)^6*tan(c)^6 - 6*b*arctan(-(tan(d*x
) - tan(c))/(tan(d*x)*tan(c) + 1))*tan(d*x)^6*tan(c)^6 + 90*a*d*x*tan(d*x)^6*tan(c)^4 + 18*b*d*x*tan(d*x)^6*ta
n(c)^4 + 9*pi*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^6*tan(c)^4 +
90*a*d*x*tan(d*x)^4*tan(c)^6 + 18*b*d*x*tan(d*x)^4*tan(c)^6 + 9*pi*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan
(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4*tan(c)^6 + 9*pi*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*t
an(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^6*tan(c)^2 + 27*pi*b*sgn(2*tan(d*x)^2*tan(c)^2 -
 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4*tan(c)^4 + 18*b*arctan(
(tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(d*x)^6*tan(c)^4 - 18*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*ta
n(c) + 1))*tan(d*x)^6*tan(c)^4 - 66*a*tan(d*x)^6*tan(c)^5 + 6*b*tan(d*x)^6*tan(c)^5 + 9*pi*b*sgn(2*tan(d*x)^2*
tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^2*tan(c)^6 + 18
*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(d*x)^4*tan(c)^6 - 18*b*arctan(-(tan(d*x) - tan(c))/(t
an(d*x)*tan(c) + 1))*tan(d*x)^4*tan(c)^6 - 66*a*tan(d*x)^5*tan(c)^6 + 6*b*tan(d*x)^5*tan(c)^6 + 90*a*d*x*tan(d
*x)^6*tan(c)^2 + 18*b*d*x*tan(d*x)^6*tan(c)^2 + 9*pi*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(
d*x) - 2*tan(c))*tan(d*x)^6*tan(c)^2 + 270*a*d*x*tan(d*x)^4*tan(c)^4 + 54*b*d*x*tan(d*x)^4*tan(c)^4 + 27*pi*b*
sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4*tan(c)^4 + 90*a*d*x*tan(d*x
)^2*tan(c)^6 + 18*b*d*x*tan(d*x)^2*tan(c)^6 + 9*pi*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*
x) - 2*tan(c))*tan(d*x)^2*tan(c)^6 + 3*pi*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*
x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^6 + 27*pi*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan
(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4*tan(c)^2 + 18*b*arctan((tan(d*x) + tan(c))/(tan(
d*x)*tan(c) - 1))*tan(d*x)^6*tan(c)^2 - 18*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1))*tan(d*x)^6*tan
(c)^2 - 80*a*tan(d*x)^6*tan(c)^3 - 16*b*tan(d*x)^6*tan(c)^3 + 27*pi*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*ta
n(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^2*tan(c)^4 + 54*b*arctan((tan(d*x) + t
an(c))/(tan(d*x)*tan(c) - 1))*tan(d*x)^4*tan(c)^4 - 54*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1))*ta
n(d*x)^4*tan(c)^4 + 90*a*tan(d*x)^5*tan(c)^4 - 78*b*tan(d*x)^5*tan(c)^4 + 90*a*tan(d*x)^4*tan(c)^5 - 78*b*tan(
d*x)^4*tan(c)^5 + 3*pi*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan
(d*x) - 2*tan(c))*tan(c)^6 + 18*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(d*x)^2*tan(c)^6 - 18*b
*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1))*tan(d*x)^2*tan(c)^6 - 80*a*tan(d*x)^3*tan(c)^6 - 16*b*tan(
d*x)^3*tan(c)^6 + 30*a*d*x*tan(d*x)^6 + 6*b*d*x*tan(d*x)^6 + 3*pi*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(
c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^6 + 270*a*d*x*tan(d*x)^4*tan(c)^2 + 54*b*d*x*tan(d*x)^4*tan(c)^2 + 27*p
i*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4*tan(c)^2 + 270*a*d*x*ta
n(d*x)^2*tan(c)^4 + 54*b*d*x*tan(d*x)^2*tan(c)^4 + 27*pi*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*
tan(d*x) - 2*tan(c))*tan(d*x)^2*tan(c)^4 + 30*a*d*x*tan(c)^6 + 6*b*d*x*tan(c)^6 + 3*pi*b*sgn(-2*tan(d*x)^2*tan
(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(c)^6 + 9*pi*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan
(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4 + 6*b*arctan((tan(d*x) + tan(c))/(tan
(d*x)*tan(c) - 1))*tan(d*x)^6 - 6*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1))*tan(d*x)^6 - 30*a*tan(d
*x)^6*tan(c) - 6*b*tan(d*x)^6*tan(c) + 27*pi*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan
(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^2*tan(c)^2 + 54*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c)
 - 1))*tan(d*x)^4*tan(c)^2 - 54*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1))*tan(d*x)^4*tan(c)^2 + 90*
a*tan(d*x)^5*tan(c)^2 + 18*b*tan(d*x)^5*tan(c)^2 - 240*a*tan(d*x)^4*tan(c)^3 + 144*b*tan(d*x)^4*tan(c)^3 + 9*p
i*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan
(c)^4 + 54*b*arctan((tan(d*x) + tan(c))/(tan(d*...

________________________________________________________________________________________

Mupad [B]
time = 12.54, size = 93, normalized size = 1.07 \begin {gather*} x\,\left (\frac {5\,a}{16}+\frac {b}{16}\right )+\frac {\left (\frac {5\,a}{16}+\frac {b}{16}\right )\,{\mathrm {tan}\left (c+d\,x\right )}^5+\left (\frac {5\,a}{6}+\frac {b}{6}\right )\,{\mathrm {tan}\left (c+d\,x\right )}^3+\left (\frac {11\,a}{16}-\frac {b}{16}\right )\,\mathrm {tan}\left (c+d\,x\right )}{d\,\left ({\mathrm {tan}\left (c+d\,x\right )}^6+3\,{\mathrm {tan}\left (c+d\,x\right )}^4+3\,{\mathrm {tan}\left (c+d\,x\right )}^2+1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)^6*(a + b*tan(c + d*x)^2),x)

[Out]

x*((5*a)/16 + b/16) + (tan(c + d*x)^3*((5*a)/6 + b/6) + tan(c + d*x)^5*((5*a)/16 + b/16) + tan(c + d*x)*((11*a
)/16 - b/16))/(d*(3*tan(c + d*x)^2 + 3*tan(c + d*x)^4 + tan(c + d*x)^6 + 1))

________________________________________________________________________________________